package com.zqsign.core.key.pojo;

import com.zqsign.core.key.pojo.Result;

/**
* @ClassName 	: ResultUtil 
* @Description 	: 返回值工具
*
* @Company 		: zqsign
* @author 		: wx 
* @date 		: 2017年12月25日 下午5:18:23 
*/

public class ResultUtil {
	
	public static Result success(Integer code,String msg,Object object){
		Result result = new Result();
		result.setCode(code);
		result.setMsg(msg);
		result.setData(object);
		return result;
	}
	
	public static Result success(Object object){
		Result result = new Result();
		result.setCode(0);
		result.setMsg("成功");
		result.setData(object);
		return result;
	}
	
	public static Result success(){
		return success(null);
	}
	
	public static Result error(Integer code,String msg,Object object){
		Result result = new Result();
		result.setCode(code);
		result.setMsg(msg);
		result.setData(object);
		return result;
	}
	
	public static Result error(Integer code,String msg){
		Result result = new Result();
		result.setCode(code);
		result.setMsg(msg);
		return result;
	}
}
